home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / sviluppo / svilupp2 / amphn192.lha / src / amiphonepacket.h < prev    next >
C/C++ Source or Header  |  1996-11-16  |  2KB  |  69 lines

  1. #ifndef AMIPHONEPACKET_H
  2. #define AMIPHONEPACKET_H
  3.  
  4. /* Current Version number for both AmiPhone and AmiPhoned */
  5. /* Make sure ALL THREE of these #define lines are in-sync! */
  6. #define VERSION_NUMBER         192
  7. #ifdef DEBUG_FLAG
  8. #define VERSION_STRING     "$VER: 1.92D"
  9. #else
  10. #define VERSION_STRING     "$VER: 1.92"
  11. #endif
  12.  
  13. /* common macros */
  14. #define UNLESS(x) if(!(x))
  15. #define UNTIL(x)  while(!(x))
  16. #define EXIT(m,n) {SetExitMessage(m,n);exit(n);}
  17.  
  18. /* message structures that will be passed as packets from AmiPhone to AmiPhoned */
  19. #define MIN_SAMPLE_RATE           1600
  20. #define DEFAULT_MAX_SAMPLE_RATE   9999
  21. #define ABSOLUTE_MAX_SAMPLE_RATE 32767
  22. #define MIN_PACKET_SIZE         100
  23. #define MAX_PACKET_SIZE       8950
  24. #define MAX_PACKET_INTERVAL      (0.7)
  25. #define MIN_PACKET_INTERVAL     (0.09)
  26.  
  27. /* this is the largest an AmiPhone data packet will be */
  28. #define MAXTRANSBUFSIZE        9000
  29.  
  30. #define PHONECOMMAND_CONNECT    'C'
  31.     #define PCCONNECT_CONVERSE    'T'
  32.     #define PCCONNECT_RELAY        'E'
  33.     
  34. #define PHONECOMMAND_DISCONNECT    'H'
  35. #define PHONECOMMAND_DATA    'D'
  36.  
  37. #define PHONECOMMAND_DENY    'X'
  38.  
  39. #define PHONECOMMAND_FLUSH    'F'
  40. #define PHONECOMMAND_VWARN      'V'    /* Causes Requester on receiver's end */
  41.  
  42. #define PHONECOMMAND_REPLY    'R'
  43.     #define PCREPLY_WILLLISTEN     'L'    /* subTypes for ..._REPLY */
  44.     #define PCREPLY_TWOWAY           '2'    /*               */
  45.     #define PCREPLY_LEAVEMESSAGE     'M'    /*              */
  46.     #define PCREPLY_CANTLEAVEMESSAGE 'Z'    /*                        */
  47.     
  48. #define COMPRESS_INVALID    0
  49. #define COMPRESS_NONE        1
  50. #define COMPRESS_ADPCM2        2
  51. #define COMPRESS_ADPCM3        3
  52. #define COMPRESS_MAX        4
  53.  
  54. struct AmiPhonePacketHeader {
  55.     UBYTE    ubCommand;        /* controls what to do! */
  56.     UBYTE    ubType;            /* basically a subfield of ubCommand */
  57.     LONG    lSeqNum;        /* Sequencing number */
  58.     ULONG     ulBPS;            /* Sample speed, or misc data if not a sample */
  59.     ULONG     ulDataLen;        /* number of bytes of data after this */
  60.     ULONG   ulJoinCode;        /* Used for reliable decompression of ADPCM */
  61. };
  62.  
  63.  
  64. struct AmiPhoneSendBuffer {
  65.     struct AmiPhonePacketHeader header;
  66.     UBYTE                ubData[(MAXTRANSBUFSIZE- sizeof(struct AmiPhonePacketHeader))];
  67. };
  68.  
  69. #endif